<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		 
			
  
    <meta name="twitter:card" content="summary"/>
    
      <meta name="twitter:image" content="https://www.samrainhan.com/images/avatar.png" />
    
  
  
  <meta name="twitter:title" content="Install Gentoo In Virtualbox"/>
  <meta name="twitter:description" content="思维导图文件下载 1下载mini安装包 2在Virtualbox上建立Gentoo64bit系统 网络 网卡1 混杂模式 全部允许 存储 IDE控制器 添加新"/>
  
  
  
  
    <meta name="twitter:creator" content="@韩雨"/>
  



		
		<meta name="author" content="韩雨">
		<meta name="description" content="学习 &amp;nbsp;&amp;bull;&amp;nbsp; 生活">
		<meta name="generator" content="Hugo 0.52" />
		<title>Install Gentoo In Virtualbox &middot; sam的小窝</title>
		<link rel="shortcut icon" href="https://www.samrainhan.com/images/favicon.ico">
		<link rel="stylesheet" href="https://www.samrainhan.com/css/style.css">
		<link rel="stylesheet" href="https://www.samrainhan.com/css/highlight.css">

		
		<link rel="stylesheet" href="https://www.samrainhan.com/css/font-awesome.min.css">
		

		
		<link href="https://www.samrainhan.com/index.xml" rel="alternate" type="application/rss+xml" title="sam的小窝" />
		

		
	</head>

    <body>
       <nav class="main-nav">
	
	
		<a href='https://www.samrainhan.com/'> <span class="arrow">←</span>Home</a>
	
	<a href='https://www.samrainhan.com/posts'>Archive</a>
	<a href='https://www.samrainhan.com/tags'>Tags</a>
	<a href='https://www.samrainhan.com/about'>About</a>

	

	
	<a class="cta" href="https://www.samrainhan.com/index.xml">Subscribe</a>
	
</nav>


        <section id="wrapper" class="post">
            <article>
                <header>
                    <h1>
                        Install Gentoo In Virtualbox
                    </h1>
                    <h2 class="headline">
                    Jan 15, 2013 00:00
                    · 569 words
                    · 2 minute read
                      <span class="tags">
                      
                      
                          
                              <a href="https://www.samrainhan.com/tags/gentoo">Gentoo</a>
                          
                              <a href="https://www.samrainhan.com/tags/virtualbox">Virtualbox</a>
                          
                              <a href="https://www.samrainhan.com/tags/%E8%99%9A%E6%8B%9F%E6%9C%BA">虚拟机</a>
                          
                      
                      
                      </span>
                    </h2>
                </header>
                
                  
                    <div id="toc">
                      <nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#1-下载mini安装包-http-mirrors-163-com-gentoo-releases-amd64-autobuilds-current-install-amd64-minimal-install-amd64-minimal-20121013-iso">1<a href="http://mirrors.163.com/Gentoo/Releases/Amd64/Autobuilds/Current-install-amd64-minimal/install-amd64-minimal-20121013.iso">下载mini安装包</a></a></li>
<li><a href="#2在virtualbox上建立gentoo64bit系统">2在Virtualbox上建立Gentoo64bit系统</a>
<ul>
<li><a href="#网络">网络</a></li>
<li><a href="#存储">存储</a></li>
</ul></li>
<li><a href="#3启动虚拟机">3启动虚拟机</a>
<ul>
<li><a href="#按f1">按F1</a></li>
</ul></li>
<li><a href="#4设置网络">4设置网络</a>
<ul>
<li><a href="#mkdir-run"><code>mkdir /run</code></a></li>
<li><a href="#dhcpcd-eth0"><code>dhcpcd eth0</code></a></li>
</ul></li>
<li><a href="#5验证网络">5验证网络</a>
<ul>
<li><a href="#ping-www-google-com"><code>ping www.google.com</code></a></li>
</ul></li>
<li><a href="#6启动ssh">6启动SSH</a>
<ul>
<li><a href="#etc-init-d-sshd-start"><code>/etc/init.d/sshd start</code></a></li>
</ul></li>
<li><a href="#7修改root密码">7修改root密码</a>
<ul>
<li><a href="#passwd"><code>passwd</code></a></li>
</ul></li>
<li><a href="#8分区">8分区</a>
<ul>
<li><a href="#fdisk"><code>fdisk</code></a></li>
</ul></li>
<li><a href="#9安装stage3">9安装Stage3</a>
<ul>
<li><a href="#1下载文件">1下载文件</a></li>
<li><a href="#2安装文件">2安装文件</a></li>
</ul></li>
<li><a href="#10配置编译选项">10配置编译选项</a>
<ul>
<li><a href="#打开-etc-make-conf">打开/etc/make.conf</a></li>
</ul></li>
<li><a href="#11chroot">11Chroot</a>
<ul>
<li><a href="#选择境像站点">选择境像站点</a></li>
<li><a href="#拷贝dns信息">拷贝DNS信息</a></li>
<li><a href="#挂载-proc和-dev文件系统">挂载/proc和/dev文件系统</a></li>
<li><a href="#进入新的系统环境">进入新的系统环境</a></li>
</ul></li>
<li><a href="#12配置portage">12配置Portage</a>
<ul>
<li><a href="#更新portage树">更新Portage树</a></li>
<li><a href="#选择正确的profile">选择正确的Profile</a></li>
</ul></li>
</ul></li>
</ul>
</nav>
                    </div>
                  
                
                <section id="post-body">
                    

<p><a href="https://docs.google.com/file/d/0B1DrsqrLRzeIT2t2cDlpMWI3anM/edit">思维导图文件下载</a></p>

<h2 id="1-下载mini安装包-http-mirrors-163-com-gentoo-releases-amd64-autobuilds-current-install-amd64-minimal-install-amd64-minimal-20121013-iso">1<a href="http://mirrors.163.com/Gentoo/Releases/Amd64/Autobuilds/Current-install-amd64-minimal/install-amd64-minimal-20121013.iso">下载mini安装包</a></h2>

<h2 id="2在virtualbox上建立gentoo64bit系统">2在Virtualbox上建立Gentoo64bit系统</h2>

<h3 id="网络">网络</h3>

<ul>
<li>网卡1

<ul>
<li>混杂模式
全部允许</li>
</ul></li>
</ul>

<h3 id="存储">存储</h3>

<ul>
<li>IDE控制器

<ul>
<li>添加新盘
下载好的安装包</li>
</ul></li>
</ul>

<h2 id="3启动虚拟机">3启动虚拟机</h2>

<h3 id="按f1">按F1</h3>

<ul>
<li>输入<code>gentoo</code></li>
</ul>

<h2 id="4设置网络">4设置网络</h2>

<h3 id="mkdir-run"><code>mkdir /run</code></h3>

<h3 id="dhcpcd-eth0"><code>dhcpcd eth0</code></h3>

<h2 id="5验证网络">5验证网络</h2>

<h3 id="ping-www-google-com"><code>ping www.google.com</code></h3>

<h2 id="6启动ssh">6启动SSH</h2>

<h3 id="etc-init-d-sshd-start"><code>/etc/init.d/sshd start</code></h3>

<h2 id="7修改root密码">7修改root密码</h2>

<h3 id="passwd"><code>passwd</code></h3>

<h2 id="8分区">8分区</h2>

<h3 id="fdisk"><code>fdisk</code></h3>

<h2 id="9安装stage3">9安装Stage3</h2>

<h3 id="1下载文件">1下载文件</h3>

<ul>
<li><code>links http://www.gentoo.org/main/en/mirrors.xml</code>
找到asia netease
进入目录【releases/amd64/autobuilds】
找到文件stage3-amd64-20121013.tar.bz2
按D键</li>
</ul>

<h3 id="2安装文件">2安装文件</h3>

<ul>
<li><code>cd /mnt/gentoo</code></li>
<li><code>tar xvjpf stage3-*.tar.bz2</code></li>
</ul>

<h2 id="10配置编译选项">10配置编译选项</h2>

<h3 id="打开-etc-make-conf">打开/etc/make.conf</h3>

<ul>
<li><code>nano -w /mnt/gentoo/etc/make.conf</code></li>
<li>CFLAGS=&quot;-march=k8 -O2 -pipe&quot;   # EM64T应该使用-march=nocona # 两个变量使用相同的设置 CXXFLAGS=&quot;${CFLAGS}&quot;  # j后面的数字是CPU的数目加一 MAKEOPTS=&quot;-j2&quot;</li>
</ul>

<h2 id="11chroot">11Chroot</h2>

<h3 id="选择境像站点">选择境像站点</h3>

<ul>
<li>使用mirrorselect更新GENTOO_MIRRORS变量
<code>mirrorselect -i -o &amp;gt;&amp;gt; /mnt/gentoo/etc/make.conf</code></li>
<li>使用mirrorselect选择rsync镜像站点
<code>mirrorselect -i -r -o &amp;gt;&amp;gt; /mnt/gentoo/etc/make.conf</code></li>
<li>再检查一下/mnt/gentoo/etc/make.conf里的设置</li>
</ul>

<h3 id="拷贝dns信息">拷贝DNS信息</h3>

<ul>
<li><code>cp -L /etc/resolv.conf /mnt/gentoo/etc/</code></li>
</ul>

<h3 id="挂载-proc和-dev文件系统">挂载/proc和/dev文件系统</h3>

<ul>
<li><code>mount -t proc none /mnt/gentoo/proc mount -o bind /dev /mnt/gentoo/dev</code></li>
</ul>

<h3 id="进入新的系统环境">进入新的系统环境</h3>

<ul>
<li>chroot到新环境里
<code>chroot /mnt/gentoo /bin/bash env-update source /etc/profile export PS1=&amp;quot;(chroot) $PS1&amp;quot;</code></li>
</ul>

<h2 id="12配置portage">12配置Portage</h2>

<h3 id="更新portage树">更新Portage树</h3>

<ul>
<li><code>emerge --sync --quiet</code></li>
</ul>

<h3 id="选择正确的profile">选择正确的Profile</h3>

<ul>
<li>验证系统profile
<code>eselect profile list</code></li>
<li>切换profile
<code>eselect profile set 2</code></li>
<li>切换到non-multilib profile</li>
</ul>

                </section>
            </article>

            
                <a class="twitter" href="https://twitter.com/intent/tweet?text=https%3a%2f%2fwww.samrainhan.com%2fposts%2f2013-01-15-install-gentoo-in-virtualbox%2f - Install%20Gentoo%20In%20Virtualbox "><span class="icon-twitter"> tweet</span></a>

<a class="facebook" href="#" onclick="
    window.open(
      'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),
      'facebook-share-dialog',
      'width=626,height=436');
    return false;"><span class="icon-facebook-rect"> Share</span>
</a>

            

            
                <div id="disqus_thread"></div>
<script type="text/javascript">
    var disqus_shortname = 'samrainblogbygithub'; 

     
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>

            

            
                <ul id="post-list" class="archive readmore">
    <h3>Read more</h3>

    
    
    
        <li>
            <a href="/posts/2019-04-26-c9-move-to-aws-c9/">Cloud9 Move to Aws C9<aside class="dates">Apr 26 2019</aside></a>
        </li>
    
        <li>
            <a href="/posts/2019-02-16-why-build-blog-with-cloud9/">2019 02 16 Why Build Blog With Cloud9<aside class="dates">Feb 16 2019</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-sports-stretching-best-practices/">运动拉伸最佳实践<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-add-2-files-to-tempdb-for-caching/">给tempdb加2个文件做缓存<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-look-for-sql-server-tables-without-a-clustered-index/">如何找到没有聚集索引的表<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-the-continuous-delivery-maturity-model/">持续实施成熟度模型<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-map-of-continuous-delivery/">持续发布的各个阶段<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-how-dropbox-securely-stores-your-passwords/">Dropbox的用户密码加密机制<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-code-inspection-tool-for-net/">NET代码检查工具<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
        <li>
            <a href="/posts/2018-09-12-how-to-make-unique-id/">怎样生成唯一ID<aside class="dates">Sep 12 2018</aside></a>
        </li>
    
</ul>

            

            <footer id="footer">
    
        <div id="social">

	
	
    <a class="symbol" href="">
        <i class="fa fa-facebook-square"></i>
    </a>
    
    <a class="symbol" href="https://github.com/samrain">
        <i class="fa fa-github-square"></i>
    </a>
    
    <a class="symbol" href="">
        <i class="fa fa-twitter-square"></i>
    </a>
    


</div>

    
    <p class="small">
    
       © Copyright 2019 <i class="fa fa-heart" aria-hidden="true"></i> 韩雨
    
    </p>
    <p class="small">
        Powered by <a href="http://www.gohugo.io/">Hugo</a> Theme By <a href="https://github.com/nodejh/hugo-theme-cactus-plus">nodejh</a>
    </p>
</footer>

        </section>

        <script src="https://www.samrainhan.com/js/jquery-3.3.1.min.js"></script>
<script src="https://www.samrainhan.com/js/main.js"></script>
<script src="https://www.samrainhan.com/js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>




  
<script type="application/javascript">
var doNotTrack = false;
if (!doNotTrack) {
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
	ga('create', 'UA-37708730-1', 'auto');
	
	ga('send', 'pageview');
}
</script>





    </body>
</html>
